package com.basker.pisces.springcloud.hystrix.ttl;

import java.util.concurrent.Callable;

import com.alibaba.ttl.TtlCallable;
import com.netflix.hystrix.strategy.concurrency.HystrixConcurrencyStrategy;

class TTLConcurrencyStrategy extends DecoratedHystrixConcurrencyStrategy {

    TTLConcurrencyStrategy(HystrixConcurrencyStrategy existingConcurrencyStrategy) {
        super(existingConcurrencyStrategy);
    }

    @Override
    public <T> Callable<T> wrapCallable(Callable<T> callable) {
        TtlCallable<T> ttlCallable = TtlCallable.get(callable);
        return super.wrapCallable(ttlCallable);
    }

}
